Working with the Prizm Platform Services > Developer Reference - Prizm Services > PCC RESTful API > Work Files |
Creates a new WorkFile.
A WorkFile can be any file, including a PDF document, XML document or PNG image. The purpose of a WorkFile is for temporary storage of files so they can be shared by various PCC Services that need to act on it. A WorkFile can be a file you provide as input to a process or a file provided to you as output from a process.
A WorkFile should not be used for archival storage. By default, WorkFile objects will be automatically deleted 24 hours after they are created.
Http Method
POST
Parameters
Name | Description | Details |
FileExtension |
This is the file extension of the file to be added as a WorkFile. This parameter may or may not be required depending on the file type and whether Format Detection is enabled. Note that the extension must not include the leading period (for example, 'jpg' is accepted but '.jpg' will return a 400 HTTP status). Extensions are not case sensitive. If Format Detection is disabled, the FileExtension must be provided. If Format Detection is enabled (default), the use of the FileExtension is as follows:
|
string, required Example: pdf |
MinSecondsAvailable |
The minimum number of seconds which this WorkFile must remain available. If not provided, a configurable default value is used. This value is ignored if it is shorter than the configurable value. |
integer, optional Example: 60 |
Request Body
The binary file data.
Response Body
If successful, this method returns JSON containing the following properties:
Name | Description | Details |
fileId |
The ID of the newly created WorkFile. This ID can be used in other requests that accept a WorkFile ID as input. |
string, required Example: CVBuD7DbQYNoJDqByGierQ |
fileExtension |
If Format Detection is disabled, this is the FileExtension provided in the request. If Format Detection is enabled (default), this may be the FileExtension provided in the request or it may be replaced with another value depending upon the results of the Format Detection process:
|
|
affinityToken | Affinity token used to indicate which server the resource is hosted on. This value will only be present if PCC is running in multi-server mode. |
string Example: "rcqmuB9pAa8+4V7fhO1SXzawy/YMQU1g8lLdNDe5l7w=" |
Status Codes
Examples
Example Request |
Copy Code
|
---|---|
POST http://localhost:18681/PCCIS/V1/WorkFile?FileExtension=pdf
Content-Type: application/octet-stream
[binary file data]
|
Example Response |
Copy Code
|
---|---|
200 OK
Content-Type: application/json
{
"fileId": workFileId
}
|
Gets the data associated with an existing WorkFile.
The response will set the Content-Type header value to the registered MIME type associated with document extension of the work file. If a registered MIME type is not found, the value "application/octet-stream" is used.
Http Method
GET
Request Headers
Name | Value | Details |
Accusoft-Affinity-Token |
Affinity token returned in post response body for work file specified by WorkFileId parameter in URI. Example: "rcqmuB9pAa8+4V7fhO1SXzawy/YMQU1g8lLdNDe5l7w=" |
Only required if PCC is running in multi-server mode. |
Parameters
Name | Description | Details |
WorkFileId |
ID of the WorkFile to retrieve |
string, required Example: CVBuD7DbQYNoJDqByGierQ |
ContentDispositionFilename |
Name to use in the filename attribution of the Content-Disposition response header. The default value is "file-{WorkFileId}.{extension}". The file extension of the work file will automatically be added to the Content-Disposition filename. |
string, optional Example: MonthlySalesReport |
Request Body
None
Response Body
The binary file data.
Status Codes
Examples
Example Request |
Copy Code
|
---|---|
GET http://localhost:18681/PCCIS/V1/WorkFile/CVBuD7DbQYNoJDqByGierQ?ContentDispositionFilename=MontlySalesReport
|
Example Response |
Copy Code
|
---|---|
200 OK Content-Type: application/pdf Content-Disposition: attachment; filename=MonthlySalesReport.pdf [binary file data] |